package gui.gui2d.highLevelPanels;


import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.JPanel;
import utility.PieceImage;

public class OpponentEatenListPanel extends JPanel {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	GridBagConstraints c;
	int tot=0;
	int insertInx=0;
	int insertIny=0;

	public OpponentEatenListPanel() {
		this.setLayout(new GridBagLayout());
		this.setOpaque(false);
		c = new GridBagConstraints();
		c.weighty = 1;
		c.ipady = 0; 
		c.ipadx = 0;  
	}
	
	public void putPiece(PieceImage pi){
		if(tot>15){return;}
		tot++;
		c.gridx = insertInx;
		c.gridy = insertIny;
		this.add(pi,c);		
		insertInx++;
		if(insertInx>1){
			insertInx=0;
			insertIny++;
		}
	}

}
